﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Web.Script.Services;
using System.Web.Script.Serialization;
using PhuLeBooze.Global;
using PhuLeBussinessObject.Core;
using PhuLeDao.News;
using PhuLeBooze.Global;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.Script.Serialization;
using System.Xml;
using PhuLeBussinessObject.Base;
using PhuLeBooze.UICode;
using PhuLeBussinessObject.News;
using Newtonsoft.Json;

namespace PhuLeBooze.Views.News.Service
{
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]
    // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. 
    // [System.Web.Script.Services.ScriptService]
    [System.Web.Script.Services.ScriptService]
    public class NewsService : System.Web.Services.WebService
    {

        [WebMethod(EnableSession = true)]
        [ScriptMethod(ResponseFormat = ResponseFormat.Json)]
        public string GetNewsDetailByID(string ID)
        {
            CNewUI newID = new CNewUI();
            CNews item = newID.GetNewDetail(ID);

            string output = JsonConvert.SerializeObject(item);

            return output;
        }
    }
}
